import uvicorn
from fastapi import FastAPI, Depends

from internal import admin
from routes import items, users
from routes.dependencies.head import get_query_token, get_token_header

app = FastAPI(dependencies=[Depends(get_query_token)])

app.include_router(users.route)
app.include_router(items.router)
app.include_router(
    admin.router,
    prefix="/admin",
    tags=["后台模块"],
    dependencies=[Depends(get_token_header)],
    responses={418: {"description": "I'm a teapot"}},
)


@app.get("/")
def read_root():
    return {"Hello": "World"}


if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)
